package Job03.Rectangle;

import Job03.Shapes.Shapes;

public class Rectangle extends Shapes {
    private double width;//宽
    private double length;//长

    public double getWidth() {
        return width;
    }
    public void setWidth(double width) {
        this.width = width;
    }
    public double getLength() {
        return length;
    }
    public void setLength(double length) {
        this.length = length;
    }

    public Rectangle(double width, double length) {
        this.width = width;
        this.length = length;
    }

    public Rectangle() {
    }

    @Override
    public void Shapes() {
        System.out.println("矩形周长和面积");
    }

    @Override
    public void area() {//面积
        System.out.println("面积:" +(this.getLength()+this.getWidth()));
    }

    @Override
    public void c() {
        System.out.println("周长:" +(this.getLength()+this.getWidth())*2);
    }

}
